package net.rlair.es.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.elasticsearch.annotations.Document;

import java.util.Date;

/**
 * 包括图片新闻、红头、蓝头、公告.
 *
 * @author yaoyi
 * @version 1.0.0.0
 * @since 2018/3/13
 */

@Document(indexName = "oa_index", type = "article")
public class Article{

    /**
     * id.
     */
    //@Id
    //@Field(index = FieldIndex.not_analyzed, store = true, type = FieldType.String)
    private String id;
    /**
     * 创建用户岗位ID.
     */
    private Integer createuser;
    /**
     * 用户名称.
     */
    private String createusername;
    /**
     * 创建时间.
     */
    private Date createtime;
    /**
     * 更新时间.
     */
    private Date updatetime;
    /**
     * 主题.
     */
    //@Field(index = FieldIndex.analyzed, analyzer = "ik", store = true, searchAnalyzer = "ik", type = FieldType.String)
    private String subject;
    /**
     * 摘要.
     */
    private String abstracttext;
    /**
     * 关键字.
     */
    private String keyword;
    /**
     * 内容.
     */
    //@Field(index = FieldIndex.analyzed, analyzer = "ik", store = true, searchAnalyzer = "ik", type = FieldType.String)
    private String content;
    /**
     * 附件id.
     */
    private String attachmentid;
    /**
     * 附件名.
     */
    private String attachmentname;
    /**
     * 类型 1_新闻、2_瑞航文件(红蓝头)、3_集团文件、4_局方文件、5_公告.
     */
    private String type;
    /**
     * 状态 E_编辑、P_发布、D_删除.
     */
    private String status;
    /**
     * 可见范围-部门.
     */
    private String viewdeptid;
    /**
     * 可见范围--部门名称.
     */
    private String viewdeptname;
    /**
     * 可见范围-人.
     */
    private String viewpersonid;
    /**
     * 可见范围-人名.
     */
    private String viewpersonname;
    /**
     * 是否被收藏.
     */
    private boolean collection = false;

    /**
     * 可见范围-人岗位.
     */
    private String viewpersonjob;
    /**
     * 是否置顶.
     */
    private Boolean isTop = false;
    /**
     * 发文稿纸.
     */
    private String reference;

    /**
     * 归档状态：1.未归档、2.归档中、3.归档成功、4.归档失败.
     */
    private Integer archiveStatus;

    public void setId(final String id) {
        this.id = id;
    }

    public String getId() {
        return this.id;
    }

    public void setCreateuser(final Integer createuser) {
        this.createuser = createuser;
    }

    public Integer getCreateuser() {
        return this.createuser;
    }

    public void setCreateusername(final String createusername) {
        this.createusername = createusername;
    }

    public String getCreateusername() {
        return this.createusername;
    }

    public void setCreatetime(final Date createtime) {
        this.createtime = createtime;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "Asia/Shanghai")
    public Date getCreatetime() {
        return this.createtime;
    }

    public void setUpdatetime(final Date updatetime) {
        this.updatetime = updatetime;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "Asia/Shanghai")
    public Date getUpdatetime() {
        return this.updatetime;
    }

    public void setSubject(final String subject) {
        this.subject = subject;
    }

    public String getSubject() {
        return this.subject;
    }

    public void setContent(final String content) {
        this.content = content;
    }

    public String getContent() {
        return this.content;
    }

    public void setAttachmentid(final String attachmentid) {
        this.attachmentid = attachmentid;
    }

    public String getAttachmentid() {
        return this.attachmentid;
    }

    public void setAttachmentname(final String attachmentname) {
        this.attachmentname = attachmentname;
    }

    public String getAttachmentname() {
        return this.attachmentname;
    }

    public void setType(final String type) {
        this.type = type;
    }

    public String getType() {
        return this.type;
    }

    public void setStatus(final String status) {
        this.status = status;
    }

    public String getStatus() {
        return this.status;
    }

    public void setViewdeptid(final String viewdeptid) {
        this.viewdeptid = viewdeptid;
    }

    public String getViewdeptid() {
        return this.viewdeptid;
    }

    public void setViewdeptname(final String viewdeptname) {
        this.viewdeptname = viewdeptname;
    }

    public String getViewdeptname() {
        return this.viewdeptname;
    }

    public String getAbstracttext() {
        return abstracttext;
    }

    public void setAbstracttext(final String abstracttext) {
        this.abstracttext = abstracttext;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(final String keyword) {
        this.keyword = keyword;
    }

    public String getViewpersonid() {
        return viewpersonid;
    }

    public void setViewpersonid(final String viewpersonid) {
        this.viewpersonid = viewpersonid;
    }

    public String getViewpersonname() {
        return viewpersonname;
    }

    public void setViewpersonname(final String viewpersonname) {
        this.viewpersonname = viewpersonname;
    }

    public String getViewpersonjob() {
        return viewpersonjob;
    }

    public void setViewpersonjob(final String viewpersonjob) {
        this.viewpersonjob = viewpersonjob;
    }

    public boolean isCollection() {
        return collection;
    }

    public void setCollection(final boolean collection) {
        this.collection = collection;
    }

    public void setIsTop(final Boolean top) {
        isTop = top;
    }

    public Boolean getIsTop() {
        return isTop;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(final String reference) {
        this.reference = reference;
    }

    public Integer getArchiveStatus() {
        return archiveStatus;
    }

    public void setArchiveStatus(final Integer archiveStatus) {
        this.archiveStatus = archiveStatus;
    }
}